//
//  HXInformTableViewCell.m
//  KD
//
//  Created by Hubery on 16/1/29.
//  Copyright © 2016年 ifly. All rights reserved.
//

#import "HXInformTableViewCell.h"

@interface HXInformTableViewCell()
@property (weak, nonatomic) IBOutlet UILabel *titleLabel;
@property (weak, nonatomic) IBOutlet UILabel *timeLabel;
@property (weak, nonatomic) IBOutlet UILabel *messageLabel;
@property (weak, nonatomic) IBOutlet UIView *stateView;
@property (weak, nonatomic) IBOutlet UIImageView *stateImageView;
@end

@implementation HXInformTableViewCell

- (void)setData:(HXInformListResultModel *)data{
    _data = data;
    self.titleLabel.text = data.Title;
    NSString *str = data.SendDate;
    if(str.length>=10)str = [str substringToIndex:10];
    self.timeLabel.text = str;
    self.messageLabel.text = data.Content;
    self.stateView.layer.cornerRadius = 28.5;
    if ([data.IsRead isEqualToString:@"1"]) {//读了
        self.stateImageView.image = [UIImage imageNamed:@"open"];
        
        self.timeLabel.font = [UIFont systemFontOfSize:15.0];
        self.titleLabel.font = [UIFont systemFontOfSize:15.0];
        self.messageLabel.font = [UIFont systemFontOfSize:15.0];
        
    }else{
        
        self.stateImageView.image = [UIImage imageNamed:@"close"];
//        self.titleLabel.font = [UIFont boldSystemFontOfSize:16];
        self.titleLabel.font = [UIFont fontWithName:@ "Arial-BoldMT"  size:(16.0)];
        self.messageLabel.font = [UIFont fontWithName:@"Arial-BoldMT" size:(15.0)];
        self.timeLabel.font = [UIFont fontWithName:@"Arial-BoldMT" size:(15.0)];
        
    }
}

@end
